package com.tencent.mm.opensdk.channel;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.tencent.mm.opensdk.utils.Log;
import com.tencent.mm.opensdk.utils.TecentUtil;

public class MMessageActV2
{
  private static final String TAG = "MicroMsg.SDK.MMessageAct";
  public static final String DEFAULT_ENTRY_CLASS_NAME = ".wxapi.WXEntryActivity";
  public static final String MM_ENTRY_PACKAGE_NAME = "com.tencent.mm";
  public static final String MM_MSG_ENTRY_CLASS_NAME = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
  
  public static boolean send(Context paramContext, Args paramArgs)
  {
    if ((paramContext == null) || (paramArgs == null))
    {
      Log.e("MicroMsg.SDK.MMessageAct", "send fail, invalid argument");
      return false;
    }
    if (TecentUtil.isEmpty(paramArgs.targetPkgName))
    {
      Log.e("MicroMsg.SDK.MMessageAct", "send fail, invalid targetPkgName, targetPkgName = " + paramArgs.targetPkgName);
      return false;
    }
    if (TecentUtil.isEmpty(paramArgs.targetClassName)) {
      paramArgs.targetClassName = (paramArgs.targetPkgName + ".wxapi.WXEntryActivity");
    }
    Log.d("MicroMsg.SDK.MMessageAct", "send, targetPkgName = " + paramArgs.targetPkgName + ", targetClassName = " + paramArgs.targetClassName);
    Intent localIntent;
    (localIntent = new Intent()).setClassName(paramArgs.targetPkgName, paramArgs.targetClassName);
    if (paramArgs.bundle != null) {
      localIntent.putExtras(paramArgs.bundle);
    }
    String str = paramContext.getPackageName();
    localIntent.putExtra("_mmessage_sdkVersion", 620756998);
    localIntent.putExtra("_mmessage_appPackage", str);
    localIntent.putExtra("_mmessage_content", paramArgs.content);
    localIntent.putExtra("_mmessage_checksum", ChannelInfo.checksum(paramArgs.content, 620756998, str));
    if (paramArgs.flags == -1) {
      localIntent.addFlags(268435456).addFlags(134217728);
    } else {
      localIntent.setFlags(paramArgs.flags);
    }
    try
    {
      paramContext.startActivity(localIntent);
    }
    catch (Exception e)
    {
      Log.e("MicroMsg.SDK.MMessageAct", "send fail, ex = " + e.getMessage());
      return false;
    }
    Log.d("MicroMsg.SDK.MMessageAct", "send mm message, intent=" + localIntent);
    return true;
  }
  
  public static class Args
  {
    public static final int INVALID_FLAGS = -1;
    public String targetPkgName;
    public String targetClassName;
    public String content;
    public int flags = -1;
    public Bundle bundle;
    
    public String toString()
    {
      return "targetPkgName:" + this.targetPkgName + ", targetClassName:" + this.targetClassName + ", content:" + this.content + ", flags:" + this.flags + ", bundle:" + this.bundle;
    }
  }
}



/* Location:           C:\Users\Mr Ding\Desktop\Android_SDK_5.0.6\libs\wechat-sdk-android-without-mta-1.3.4.jar

 * Qualified Name:     com.tencent.mm.opensdk.channel.MMessageActV2

 * JD-Core Version:    0.7.0.1

 */